DB2存储过程模板(存储过程举例、编译、运行)

您所在的位置:网站首页 dbvisualizer 怎么编辑存储过程 DB2存储过程模板(存储过程举例、编译、运行)

DB2存储过程模板(存储过程举例、编译、运行)

2024-07-09 09:26| 来源: 网络整理| 查看: 265

一、DB2存储过程中日志表建表语句:

create table db2inst1.dim_proc_run_log ( proc_name varchar(200) , proc_para varchar(20) , step_no integer , step_desc varchar(100) , step_over_time timestamp , step_records integer )distribute by hash(proc_name,proc_para,step_no) in userspace1 not logged initially ; --注释 comment on table db2inst1.dim_proc_run_log is '存储过程运行日志表'; comment on column db2inst1.dim_proc_run_log.proc_name is '存储过程名称'; comment on column db2inst1.dim_proc_run_log.proc_para is '数据账期'; comment on column db2inst1.dim_proc_run_log.step_desc is '步骤说明'; comment on column db2inst1.dim_proc_run_log.step_no is '步骤'; comment on column db2inst1.dim_proc_run_log.step_over_time is '运行结束时间'; comment on column db2inst1.dim_proc_run_log.step_records is '更新记录数';

二、存储过程举例(SQL文件):proc_test_proc.sql,脚本文件建议使用utf8编码

create or replace procedure db2inst1.proc_test_proc (in i_date varchar(20),out o_return_code integer, out o_return_msg varchar(300) ) p1: begin --***************************************************************************************** -- sql 存储过程 -- 名称 : proc_test_proc -- 频率 : 日 -- 参数 : i_date: 统计日期 -- o_return_code: 返回值 -- o_return_msg: 返回信息 -- 功能描述 : 测试 -- 返回值 : 0 正确;


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3